package cn.wolfcode.controller;

import cn.wolfcode.domain.Poetry;
import cn.wolfcode.util.HttpClientUtil;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HttpController {

    @GetMapping("/poetry")
    public Object findPoetry(String url){
        if (!url.contains("www.shicimingju.com")){
            return new Poetry();
        }
        return HttpClientUtil.findPoetry(url);
    }
}
